library(RWeka);
source("src/craftData.r");
source("src/unbindData.r");
selectors=list(breast="left", img.type="mlo");
trainData<-craftData(dataAll,selectors=selectors);
trainData<-unbindData(trainData, names(info), c("class"));
control=Weka_control("cost-matrix"=matrix(c(0,1000,1,0),ncol=2), W="weka.classifiers.functions.SMO");

classifier<-CostSensitiveClassifier(class~.,data=trainData, control=control);
print(evaluate_Weka_classifier(classifier, numFolds=10))

print("training a classifier for bagging");
control_bagging=Weka_control("cost-matrix"=matrix(c(0,100,1,0),ncol=2), W="weka.classifiers.meta.Bagging");
classifier_bagging<-CostSensitiveClassifier(class~.,data=trainData, control=control_bagging);
print(evaluate_Weka_classifier(classifier_bagging, numFolds=10))
